package com.googlecode.connectlet.crypto.rsa;

import java.security.interfaces.RSAPrivateCrtKey;
import java.security.interfaces.RSAPublicKey;

import com.googlecode.connectlet.crypto.digest.DigestStream;
import com.googlecode.connectlet.crypto.digest.MD5Stream;

public class MD5RSAStream extends RSASignatureStream {
	private static final long serialVersionUID = 1L;

	public static final byte[] MD5RSA_HEADER = {
		0x30, 0x20,
			0x30, 0x0c,
				0x06, 0x08, 0x2a, (byte) 0x86, 0x48, (byte) 0x86, (byte) 0xf7, 0x0d, 0x02, 0x05,
				0x05, 0x00,
			0x04, 0x10
	};

	public MD5RSAStream(RSAPublicKey publicKey) {
		super(publicKey);
	}

	public MD5RSAStream(RSAPrivateCrtKey privateKey) {
		super(privateKey);
	}

	@Override
	protected DigestStream getDigestStream() {
		return new MD5Stream();
	}

	@Override
	protected byte[] getHeader() {
		return MD5RSA_HEADER;
	}
}